/************************************************************************
 * @file AbstractMenuManager.h
 * @author Ian Chen
 * @version 1.0
 *
 * @section LICENSE
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 3 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
 * General Public License for more details at
 * http://www.gnu.org/licenses/lgpl.html
 *
 ************************************************************************/
#ifndef ABSTRACTMENUMANAGER_H
#define ABSTRACTMENUMANAGER_H

#include <map>
using namespace std;

#include <QMenu>

#include <pluginui/pluginui_global.h>

namespace antu
{
namespace plugin
{
namespace ui
{
class PLUGINUISHARED_EXPORT AbstractMenuManager
{
public:
    AbstractMenuManager();

    /*!
     * \brief Finds a top level menu item without creating it.
     * \param name Name of the top level menu item.
     * \return \c Top level QMenu item that has a name corresponds to \c name parameter.
     */
    QMenu* menu(const QString& name);

    QMenu* menu(const QString& name, const QString& title, const QIcon& icon = QIcon());

    virtual bool hasMenus();

protected:
    map<QString, QMenu*> m_oMainMenuSections;

protected:
    virtual QMenu* createMenu(const QString& name, const QString& title, const QIcon& icon = QIcon()) = 0;
};
}
}
}
#endif // ABSTRACTMENUMANAGER_H
